package valuetransfer;

/**
 * @author shkstart
 * @date 2022/4/26 - 21:48
 */
public class Circle {
    public static void main(String[] args) {
        PassObject p1 = new PassObject();
        Circle c1 = new Circle();
        int time = 8;
        p1.printAreas(c1,time);//c1是地址值，让printAreas方法可以找到Circle中的属性与方法进行测试
        System.out.println("now radius is " + c1.radius);
    }
    double radius;

    public double  findArea(double radius){
      double  findArea= Math.PI * radius *radius;
      return findArea;
    }

}
class PassObject{
    public void printAreas(Circle c,int time){
        Circle c1 = c;
        System.out.println("Radius" +"\t\t\t\t\t\t\t" +"Area");
        for(double i = 1; i <= time; i++){
            c1.radius = i;
            System.out.println(i + "\t\t\t\t\t\t\t" + c1.findArea(i));
        }
        c1.radius = time + 1;
    }
}
